import {Nuxt, Builder} from 'nuxt'
import express from 'express'
const app = express()
const host = process.env.HOST || '0.0.0.0'
const port = process.env.PORT || 1024

let config = require('../nuxt.config.js')
const nuxt = new Nuxt(config)
if (config.dev) {
  const builder = new Builder(nuxt)
  builder.build()
}
app.use(nuxt.render)
app.listen(port, host)
console.log('Server listening on ' + host + ':' + port)
